<?php
/**
*
* @author Blackpawn blackpawn666@hotmail.com - http://blackpawnsarchives.net
* @co_author GameCharmer admin@gamecharmer.com - http://gaming.gamecharmer.com
* @package Age of Dragons Mod :: ( Game Console Required )
* @version $Id: install.php 1.1.1 12-26-2009 Blackpawn
* @copyright (c) 2009 Blackpawns Archives
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

$game_name = 'Age of Dragons';

$game_desc = 'The Age of Dragons is a free online fantasy text based strategy game. 
You must build an army up to defend your kingdom and keep your precious citizens 
from being kidnapped by other kingdoms. The only requirements are a internet 
connection , web browser and free time.';

// Version Major
$game_ver_major = 1;

// Version Minor
$game_ver_minor = 1;

// Version Build
$game_ver_build = 1;

// Folder where game is installed
$game_path = 'aod';

// Game author
$game_author = 'Blackpawn & GameCharmer';

$game_email = '<a href="mailto:blackpawn666@hotmail.com">Blackpawn</a> - <a href="mailto:admin@gamecharmer.com">GameCharmer</a>';

$game_website = '<a href="http://blackpawnsarchives.net" target="_blank">http://blackpawnsarchives.net</a>';

$game_credits = '
The phpBB Group for providing us with the phpBB3 Forum Software<br>
The people out there that play and use my software<br>';

$game_history = '
<b>Oct 29,2009</b><br />
-> First release<br />
<br />
<b>Dec 08,2009</b><br>
-> Removed the drop down combo boxes from the market because they were causing the page to load extremely with large numbers<br />
-> Bug Fix - Now when the round restarts all players will be removed so they can recreate their new kingdoms with out problems<br />
<br />
<b>Dec 15,2009</b><br>
-> Bug Fix - The bug that prevented you from taking quests because your kingdoms did not meet the land requirements has been fixed<br />
-> Temp Bug Fix - The bug that allows your kingdom to some times receive extra resources from attacking zero networth kingdoms has been prevented by not allowing anyone to attack any kingdoms under 1000 networth points<br />
-> Addon - More quest parameters have been added to help you make more unique quests<br />
-> Addon - A version update checking page has been added tp the Admin CP<br />
-> Addon - A building config page has been added tp the Admin CP to allow admins to be able to config buildings<br />
-> Addon - A unit config page has been added tp the Admin CP to allow admins to be able to config units<br />
<br />
<b>Dec 16,2009</b><br>
-> The header was rebuilt now more dynamic and less work to change something on the header<br />
-> Bug Fix - The Iron Mine bug on the quests page has been fixed<br />
<br />
<b>Dec 17,2009</b><br />
-> Complete overhaul of the header along with adding a footer<br />
-> Added a Maximum amount of soldiers that you can train display right above the amount box on the Barracks page<br />
-> Added a new column on Barracks page to show the maximum amount of units that can be trained<br />
-> Added a Maximum amount of land that you can explore display right above the amount box on the Land page<br />
-> Added a new column on Land page to show the maximum amount of buildings that can be built<br />
-> Addon - New shop that uses the popular ultimate points system so now you can buy resources with your points that you saved up<br />
-> Added a new blackmarket config page in the Admin CP<br />
-> Added a new Shop config page in the Admin CP<br />
-> Added 2 new options on the Game Config page in the Admin CP to allow the admins to close the blackmarket and shop if needed<br />
-> Bug Fix - The bug in the attack script that makes your iron decrease has been fixed<br />
-> Addon - A new game signature has been added (Special Thanks to GameChamer)<br />
<br />
<b>Dec 23,2009</b><br />
-> The exp_to_next_level function was rewritten to have a better scaling system<br />
-> The calc_exp function was rewritten to make it a little easier to score EXP when attacking other kingdoms<br />
-> Added Exp points as rewards on the quests<br />
-> Added the rest of the units as rewards on the quests<br />
-> Added units of land as rewards on the quests<br />
-> Added the buildings as rewards on the quests<br />
-> Added a new description field for the quests<br />
-> Added the ability to add quest image to the quests<br />
-> Added a unit page to the guide to show all the units in the game<br />
-> Changed the quest page layout<br />
-> Bug Fix - Fixed a missing description in the Admin CP on the Building Config section<br />
-> Bug Fix - Fixed the bug in the Admin CP on the Blackmarket Config that was causing the wrong values to be set in the Blackmarket<br />
-> Bug Fix - Fixed the bug in the Admin CP on the Shop Config that was causing the wrong values to be set in the Shop<br />
-> Bug Fix - Fixed the games member count display on the game index page<br />

';

$game_license = '
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">
<img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png" /></a>
<br />
<span xmlns:dc="http://purl.org/dc/elements/1.1/" property="dc:title">Age of Dragons</span> 
by <a xmlns:cc="http://creativecommons.org/ns#" href="mailto:blackpawn666@hotmail.com" property="cc:attributionName" rel="cc:attributionURL">Blackpawn</a> 
is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License</a>.
<br />Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://blackpawnsarchives.net" rel="dc:source">http://blackpawnsarchives.net</a>';

$game_copyrights = 'Designed By <a href="mailto:blackpawn666@hotmail.com">Blackpawn</a>  &copy;  2007-2009 <a href="http://blackpawnsarchives.net">Blackpawns Archives</a>';


$game_sql[] = "DROP TABLE IF EXISTS `aod_blackmarket`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_blackmarket` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resource` varchar(255) COLLATE utf8_bin NOT NULL,
  `cost` int(11) NOT NULL DEFAULT '0',
  `kingdom_field` varchar(255) COLLATE utf8_bin NOT NULL,
  `kingdom_max_field` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `amount_offset` int(11) NOT NULL DEFAULT '0',
  `operator` tinyint(4) NOT NULL DEFAULT '0',
  `maxout` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23;";

$game_sql[] = "
INSERT INTO `aod_blackmarket` (`id`, `resource`, `cost`, `kingdom_field`, `kingdom_max_field`, `amount_offset`, `operator`, `maxout`) VALUES
(1, '175,000 units of gold', 1, 'kingdom_gold', '', 175000, 0, 0),
(2, '150,000 units of food', 2, 'kingdom_food', NULL, 150000, 0, 0),
(3, '125,000 units of wood', 3, 'kingdom_wood', NULL, 125000, 0, 0),
(4, '100,000 units of iron', 4, 'kingdom_iron', NULL, 100000, 0, 0),
(5, 'Refill Turns', 5, 'kingdom_turns', 'kingdom_turns_max', 0, 0, 1),
(6, 'Refill Stamina', 5, 'kingdom_stamina', 'kingdom_stamina_max', 0, 0, 1),
(7, 'Upgrage your kingdoms farms by 1 level', 10, 'kingdom_farms_lvl', NULL, 1, 0, 0),
(8, 'Upgrage your kingdoms timber mills by 1 level', 15, 'kingdom_timber_mills_lvl', NULL, 1, 0, 0),
(9, 'Upgrage your kingdoms iron mines by 1 level', 20, 'kingdom_iron_mines_lvl', NULL, 1, 0, 0),
(10, 'Upgrage your kingdoms gold mines 1 level', 30, 'kingdom_gold_mines_lvl', NULL, 1, 0, 0),
(11, 'Upgrage your kingdoms granaries by 1 level', 40, 'kingdom_granaries_lvl', NULL, 1, 0, 0),
(12, 'Upgrage your kingdoms wood sheds by 1 level', 50, 'kingdom_woodsheds_lvl', NULL, 1, 0, 0),
(13, 'Upgrage your kingdoms iron pits by 1 level', 60, 'kingdom_ironpits_lvl', NULL, 1, 0, 0),
(14, 'Upgrage your kingdoms vaults by 1 level', 70, 'kingdom_vaults_lvl', NULL, 1, 0, 0),
(15, 'Upgrage your kingdoms towers by 1 level', 80, 'kingdom_towers_lvl', NULL, 1, 0, 0),
(16, '25 Dragons', 90, 'kingdom_dragons', NULL, 25, 0, 0),
(17, '50 Sponsor Ticks', 100, 'kingdom_sponsor', NULL, 50, 0, 0),
(18, '1 extra turn added to max turns', 110, 'kingdom_turns_max', NULL, 1, 0, 0),
(19, 'Earn 1 extra turn per tick', 120, 'kingdom_turns_income', NULL, 1, 0, 0),
(20, '1 extra stamina point added to max stamina', 130, 'kingdom_stamina_max', NULL, 1, 0, 0),
(21, 'Earn 1 extra stamina per tick', 140, 'kingdom_stamina_income', NULL, 1, 0, 0),
(22, '1 Extra villager per tick', 150, 'kingdom_villagers_income', NULL, 1, 0, 0);";

$game_sql[] = "DROP TABLE IF EXISTS `aod_buildings`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_buildings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `building_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `building_net` int(11) NOT NULL DEFAULT '0',
  `building_def` int(11) NOT NULL DEFAULT '0',
  `building_gold` int(11) NOT NULL DEFAULT '0',
  `building_wood` int(11) NOT NULL DEFAULT '0',
  `building_iron` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10;";

$game_sql[] = "
INSERT INTO `aod_buildings` (`id`, `building_name`, `building_net`, `building_def`, `building_gold`, `building_wood`, `building_iron`) VALUES
(1, 'Farms', 31, 0, 100, 200, 100),
(2, 'Timber Mills', 32, 0, 250, 350, 200),
(3, 'Iron Mines', 33, 0, 500, 500, 350),
(4, 'Gold Mines', 34, 0, 100, 250, 250),
(5, 'Towers', 35, 100, 1500, 5000, 5000),
(6, 'Granaries', 36, 0, 2000, 2500, 2500),
(7, 'Wood Sheds', 37, 0, 2500, 1000, 3500),
(8, 'Iron Pits', 38, 0, 5000, 3500, 1000),
(9, 'Vaults', 39, 0, 7500, 2500, 2500);";

$game_sql[] = "DROP TABLE IF EXISTS `aod_config`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_config` (
  `config_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `config_value` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`config_name`)
) ENGINE=InnoDB;";

$game_sql[] = "
INSERT INTO `aod_config` (`config_name`, `config_value`) VALUES
('bash_penalty', '95'),
('cron_passwd', 'passwd'),
('exp_for_bash', '1'),
('farms_income_max', '250'),
('farms_income_min', '100'),
('food_per_gold', '75'),
('gold_mines_income_max', '250'),
('gold_mines_income_min', '100'),
('granaries_max', '25000'),
('iron_mines_income_max', '250'),
('iron_mines_income_min', '100'),
('iron_per_gold', '25'),
('ironpits_max', '15000'),
('kingdoms_per_page', '100'),
('land_cost_penalty', '3'),
('land_gold', '1000'),
('land_greater', '3'),
('levels_greater', '10'),
('market_open', '1'),
('net_greater' , '4'),
('offdef_advantage', '0.10'),
('quests_per_page', '10'),
('ranks_per_page', '10'),
('reports_per_page', '5'),
('shop_open', '1'),
('sponsor_def_bonus', '0.25'),
('stamina_advantage', '5'),
('start_farms', '5'),
('start_goldmines', '5'),
('start_granaries', '5'),
('start_ironmines', '5'),
('start_ironpits', '5'),
('start_timbermills', '5'),
('start_vaults', '5'),
('start_woodsheds', '5'),
('timber_mills_income_max', '250'),
('timber_mills_income_min', '100'),
('times_greater', '3'),
('turns_advantage', '5'),
('unit_cost_penalty', '2.5'),
('unitcost_advantage', '0.10'),
('vaults_max', '10000'),
('wood_per_gold', '50'),
('woodsheds_max', '20000');";

$game_sql[] = "DROP TABLE IF EXISTS `aod_kingdoms`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_kingdoms` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `admin_access` tinyint(4) NOT NULL DEFAULT '0',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `kingdom_status` tinyint(4) NOT NULL DEFAULT '0',
  `kingdom_name` varchar(50) COLLATE utf8_bin NOT NULL,
  `kingdom_ruler` varchar(50) COLLATE utf8_bin NOT NULL,
  `kingdom_advantage` tinyint(4) NOT NULL DEFAULT '0',
  `kingdom_level` int(11) NOT NULL DEFAULT '1',
  `kingdom_wins` int(11) NOT NULL DEFAULT '0',
  `kingdom_losses` int(11) NOT NULL DEFAULT '0',
  `kingdom_exp` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_pop` bigint(20) NOT NULL DEFAULT '10',
  `kingdom_net` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_off` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_off_bonus` decimal(11,2) NOT NULL DEFAULT '0.00',
  `kingdom_def` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_def_bonus` decimal(11,2) NOT NULL DEFAULT '0.00',
  `kingdom_unit_bonus` decimal(11,2) NOT NULL DEFAULT '0.00',
  `kingdom_food` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_wood` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_iron` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_gold` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_land` bigint(20) NOT NULL DEFAULT '10',
  `kingdom_total_land` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_turns` bigint(20) NOT NULL DEFAULT '10',
  `kingdom_turns_max` int(11) NOT NULL DEFAULT '10',
  `kingdom_turns_income` int(11) NOT NULL DEFAULT '1',
  `kingdom_stamina` int(11) NOT NULL DEFAULT '10',
  `kingdom_stamina_max` int(11) NOT NULL DEFAULT '10',
  `kingdom_stamina_income` int(11) NOT NULL DEFAULT '1',
  `kingdom_villagers` bigint(20) NOT NULL DEFAULT '10',
  `kingdom_villagers_income` int(11) NOT NULL DEFAULT '1',
  `kingdom_spies` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_soldiers` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_macemen` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_axemen` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_spearmen` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_swordsmen` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_legionnaires` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_knights` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_slingers` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_bowmen` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_long_bowmen` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_crossbowmen` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_light_sword_cavalry` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_heavy_sword_cavalry` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_light_archer_cavalry` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_heavy_archer_cavalry` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_paladin` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_dragon_knights` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_rams` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_catapults` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_heavy_catapults` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_ballistas` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_trebuchets` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_chimeras` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_hydras` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_basilisks` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_wyverns` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_leviathans` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_dragons` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_farms_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_farms` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_farms_income` int(11) NOT NULL DEFAULT '0',
  `kingdom_timber_mills_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_timber_mills` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_timber_mills_income` int(11) NOT NULL DEFAULT '0',
  `kingdom_iron_mines_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_iron_mines` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_iron_mines_income` int(11) NOT NULL DEFAULT '0',
  `kingdom_gold_mines_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_gold_mines` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_gold_mines_income` int(11) NOT NULL DEFAULT '0',
  `kingdom_towers_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_towers` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_granaries_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_granaries` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_granaries_max` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_woodsheds_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_woodsheds` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_woodsheds_max` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_ironpits_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_ironpits` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_ironpits_max` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_vaults_lvl` int(11) NOT NULL DEFAULT '1',
  `kingdom_vaults` bigint(20) NOT NULL DEFAULT '5',
  `kingdom_vaults_max` bigint(20) NOT NULL DEFAULT '10000',
  `kingdom_sponsor` int(11) NOT NULL DEFAULT '0',
  `kingdom_coins` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_kingdom_news`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_kingdom_news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `report` longtext COLLATE utf8_bin NOT NULL,
  `date` varchar(255) COLLATE utf8_bin NOT NULL,
  `seen` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_land_ranks`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_land_ranks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `kingdom_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `amount` bigint(20) NOT NULL DEFAULT '0',
  `round` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_net_ranks`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_net_ranks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `kingdom_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `amount` bigint(20) NOT NULL DEFAULT '0',
  `round` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_news`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `news` longtext COLLATE utf8_bin NOT NULL,
  `date` varchar(255) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  AUTO_INCREMENT=1;";

$game_sql[] = "
INSERT INTO `aod_news` (`id`, `user_id`, `news`, `date`) VALUES
(NULL, 2, 0x57656c636f6d6520746f20416765206f6620447261676f6e73, 'Oct 22 2009 12:00:00 pm');";

$game_sql[] = "DROP TABLE IF EXISTS `aod_pop_ranks`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_pop_ranks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `kingdom_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `amount` bigint(20) NOT NULL DEFAULT '0',
  `round` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_quests`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_quests` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `quest_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `quest_descript` varchar(255) COLLATE utf8_bin NOT NULL,
  `quest_img_path` varchar(255) COLLATE utf8_bin NOT NULL,
  `quest_level_req` int(11) NOT NULL DEFAULT '0',
  `quest_net_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_villagers_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_spies_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_soldiers_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_macemen_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_axemen_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_spearmen_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_swordsmen_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_legionnaires_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_knights_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_slingers_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_bowmen_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_long_bowmen_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_crossbowmen_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_light_sword_cavalry_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_heavy_sword_cavalry_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_light_archer_cavalry_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_heavy_archer_cavalry_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_paladin_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_dragon_knights_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_rams_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_catapults_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_heavy_catapults_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_ballistas_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_trebuchets_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_chimeras_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_hydras_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_basilisks_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_wyverns_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_leviathans_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_dragons_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_farms_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_timber_mills_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_iron_mines_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_gold_mines_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_towers_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_granaries_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_woodsheds_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_ironpits_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_vaults_req` bigint(20) NOT NULL DEFAULT '0',   
  `quest_land_req` bigint(20) NOT NULL DEFAULT '0',
  `quest_stamina_req` int(11) NOT NULL DEFAULT '1',
  `quest_gold_req` int(11) NOT NULL DEFAULT '0',
  `quest_food_req` int(11) NOT NULL DEFAULT '0',
  `quest_wood_req` int(11) NOT NULL DEFAULT '0',
  `quest_iron_req` int(11) NOT NULL DEFAULT '0',
  `quest_min_villagers` int(11) NOT NULL DEFAULT '0',
  `quest_max_villagers` int(11) NOT NULL DEFAULT '0',
  `quest_min_gold` int(11) NOT NULL DEFAULT '0',
  `quest_max_gold` int(11) NOT NULL DEFAULT '0',
  `quest_min_food` int(11) NOT NULL DEFAULT '0',
  `quest_max_food` int(11) NOT NULL DEFAULT '0',
  `quest_min_wood` int(11) NOT NULL DEFAULT '0',
  `quest_max_wood` int(11) NOT NULL DEFAULT '0',
  `quest_min_iron` int(11) NOT NULL DEFAULT '0',
  `quest_max_iron` int(11) NOT NULL DEFAULT '0',
  `quest_min_dragoncoins` int(11) NOT NULL DEFAULT '0',
  `quest_max_dragoncoins` int(11) NOT NULL DEFAULT '0',
  `quest_min_exp` int(11) NOT NULL DEFAULT '0',
  `quest_max_exp` int(11) NOT NULL DEFAULT '0',
  `quest_min_soldiers` int(11) NOT NULL DEFAULT '0',
  `quest_max_soldiers` int(11) NOT NULL DEFAULT '0',
  `quest_min_spies` int(11) NOT NULL DEFAULT '0',
  `quest_max_spies` int(11) NOT NULL DEFAULT '0',
  `quest_min_macemen` int(11) NOT NULL DEFAULT '0',
  `quest_max_macemen` int(11) NOT NULL DEFAULT '0',
  `quest_min_axemen` int(11) NOT NULL DEFAULT '0',
  `quest_max_axemen` int(11) NOT NULL DEFAULT '0',
  `quest_min_spearmen` int(11) NOT NULL DEFAULT '0',
  `quest_max_spearmen` int(11) NOT NULL DEFAULT '0',
  `quest_min_swordsmen` int(11) NOT NULL DEFAULT '0',
  `quest_max_swordsmen` int(11) NOT NULL DEFAULT '0',
  `quest_min_legionnaires` int(11) NOT NULL DEFAULT '0',
  `quest_max_legionnaires` int(11) NOT NULL DEFAULT '0',
  `quest_min_knights` int(11) NOT NULL DEFAULT '0',
  `quest_max_knights` int(11) NOT NULL DEFAULT '0',
  `quest_min_slingers` int(11) NOT NULL DEFAULT '0',
  `quest_max_slingers` int(11) NOT NULL DEFAULT '0',
  `quest_min_bowmen` int(11) NOT NULL DEFAULT '0',
  `quest_max_bowmen` int(11) NOT NULL DEFAULT '0',
  `quest_min_long_bowmen` int(11) NOT NULL DEFAULT '0',
  `quest_max_long_bowmen` int(11) NOT NULL DEFAULT '0',
  `quest_min_crossbowmen` int(11) NOT NULL DEFAULT '0',
  `quest_max_crossbowmen` int(11) NOT NULL DEFAULT '0',
  `quest_min_light_sword_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_max_light_sword_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_min_heavy_sword_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_max_heavy_sword_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_min_light_archer_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_max_light_archer_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_min_heavy_archer_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_max_heavy_archer_cavalry` int(11) NOT NULL DEFAULT '0',
  `quest_min_paladin` int(11) NOT NULL DEFAULT '0',
  `quest_max_paladin` int(11) NOT NULL DEFAULT '0',
  `quest_min_dragon_knights` int(11) NOT NULL DEFAULT '0',
  `quest_max_dragon_knights` int(11) NOT NULL DEFAULT '0',
  `quest_min_rams` int(11) NOT NULL DEFAULT '0',
  `quest_max_rams` int(11) NOT NULL DEFAULT '0',
  `quest_min_catapults` int(11) NOT NULL DEFAULT '0',
  `quest_max_catapults` int(11) NOT NULL DEFAULT '0',
  `quest_min_heavy_catapults` int(11) NOT NULL DEFAULT '0',
  `quest_max_heavy_catapults` int(11) NOT NULL DEFAULT '0',
  `quest_min_ballistas` int(11) NOT NULL DEFAULT '0',
  `quest_max_ballistas` int(11) NOT NULL DEFAULT '0',
  `quest_min_trebuchets` int(11) NOT NULL DEFAULT '0',
  `quest_max_trebuchets` int(11) NOT NULL DEFAULT '0',
  `quest_min_chimeras` int(11) NOT NULL DEFAULT '0',
  `quest_max_chimeras` int(11) NOT NULL DEFAULT '0',
  `quest_min_hydras` int(11) NOT NULL DEFAULT '0',
  `quest_max_hydras` int(11) NOT NULL DEFAULT '0',
  `quest_min_basilisks` int(11) NOT NULL DEFAULT '0',
  `quest_max_basilisks` int(11) NOT NULL DEFAULT '0',
  `quest_min_wyverns` int(11) NOT NULL DEFAULT '0',
  `quest_max_wyverns` int(11) NOT NULL DEFAULT '0',
  `quest_min_leviathans` int(11) NOT NULL DEFAULT '0',
  `quest_max_leviathans` int(11) NOT NULL DEFAULT '0',
  `quest_min_dragons` int(11) NOT NULL DEFAULT '0',
  `quest_max_dragons` int(11) NOT NULL DEFAULT '0',
  `quest_min_land` int(11) NOT NULL DEFAULT '0',
  `quest_max_land` int(11) NOT NULL DEFAULT '0',
  `quest_min_farms` int(11) NOT NULL DEFAULT '0',
  `quest_max_farms` int(11) NOT NULL DEFAULT '0',
  `quest_min_timber_mills` int(11) NOT NULL DEFAULT '0',
  `quest_max_timber_mills` int(11) NOT NULL DEFAULT '0',
  `quest_min_iron_mines` int(11) NOT NULL DEFAULT '0',
  `quest_max_iron_mines` int(11) NOT NULL DEFAULT '0',
  `quest_min_gold_mines` int(11) NOT NULL DEFAULT '0',
  `quest_max_gold_mines` int(11) NOT NULL DEFAULT '0',
  `quest_min_towers` int(11) NOT NULL DEFAULT '0',
  `quest_max_towers` int(11) NOT NULL DEFAULT '0',
  `quest_min_granaries` int(11) NOT NULL DEFAULT '0',
  `quest_max_granaries` int(11) NOT NULL DEFAULT '0',
  `quest_min_woodsheds` int(11) NOT NULL DEFAULT '0',
  `quest_max_woodsheds` int(11) NOT NULL DEFAULT '0',
  `quest_min_ironpits` int(11) NOT NULL DEFAULT '0',
  `quest_max_ironpits` int(11) NOT NULL DEFAULT '0',
  `quest_min_vaults` int(11) NOT NULL DEFAULT '0',
  `quest_max_vaults` int(11) NOT NULL DEFAULT '0', 
  `quest_chance` int(11) NOT NULL DEFAULT '0',
  `quest_approved` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  AUTO_INCREMENT=5;";

$game_sql[] = "
INSERT INTO `aod_quests` (`id`, `quest_name`, `quest_descript`, `quest_img_path`, `quest_level_req`, `quest_net_req`, `quest_villagers_req`, `quest_spies_req`, `quest_soldiers_req`, `quest_macemen_req`, `quest_axemen_req`, `quest_spearmen_req`, `quest_swordsmen_req`, `quest_legionnaires_req`, `quest_knights_req`, `quest_slingers_req`, `quest_bowmen_req`, `quest_long_bowmen_req`, `quest_crossbowmen_req`, `quest_light_sword_cavalry_req`, `quest_heavy_sword_cavalry_req`, `quest_light_archer_cavalry_req`, `quest_heavy_archer_cavalry_req`, `quest_paladin_req`, `quest_dragon_knights_req`, `quest_rams_req`, `quest_catapults_req`, `quest_heavy_catapults_req`, `quest_ballistas_req`, `quest_trebuchets_req`, `quest_chimeras_req`, `quest_hydras_req`, `quest_basilisks_req`, `quest_wyverns_req`, `quest_leviathans_req`, `quest_dragons_req`, `quest_farms_req`, `quest_timber_mills_req`, `quest_iron_mines_req`, `quest_gold_mines_req`, `quest_towers_req`, `quest_granaries_req`, `quest_woodsheds_req`, `quest_ironpits_req`, `quest_vaults_req`, `quest_land_req`, `quest_stamina_req`, `quest_gold_req`, `quest_food_req`, `quest_wood_req`, `quest_iron_req`, `quest_min_villagers`, `quest_max_villagers`, `quest_min_gold`, `quest_max_gold`, `quest_min_food`, `quest_max_food`, `quest_min_wood`, `quest_max_wood`, `quest_min_iron`, `quest_max_iron`, `quest_min_dragoncoins`, `quest_max_dragoncoins`, `quest_min_exp`, `quest_max_exp`, `quest_min_soldiers`, `quest_max_soldiers`, `quest_min_spies`, `quest_max_spies`, `quest_min_macemen`, `quest_max_macemen`, `quest_min_axemen`, `quest_max_axemen`, `quest_min_spearmen`, `quest_max_spearmen`, `quest_min_swordsmen`, `quest_max_swordsmen`, `quest_min_legionnaires`, `quest_max_legionnaires`, `quest_min_knights`, `quest_max_knights`, `quest_min_slingers`, `quest_max_slingers`, `quest_min_bowmen`, `quest_max_bowmen`, `quest_min_long_bowmen`, `quest_max_long_bowmen`, `quest_min_crossbowmen`, `quest_max_crossbowmen`, `quest_min_light_sword_cavalry`, `quest_max_light_sword_cavalry`, `quest_min_heavy_sword_cavalry`, `quest_max_heavy_sword_cavalry`, `quest_min_light_archer_cavalry`, `quest_max_light_archer_cavalry`, `quest_min_heavy_archer_cavalry`, `quest_max_heavy_archer_cavalry`, `quest_min_paladin`, `quest_max_paladin`, `quest_min_dragon_knights`, `quest_max_dragon_knights`, `quest_min_rams`, `quest_max_rams`, `quest_min_catapults`, `quest_max_catapults`, `quest_min_heavy_catapults`, `quest_max_heavy_catapults`, `quest_min_ballistas`, `quest_max_ballistas`, `quest_min_trebuchets`, `quest_max_trebuchets`, `quest_min_chimeras`, `quest_max_chimeras`, `quest_min_hydras`, `quest_max_hydras`, `quest_min_basilisks`, `quest_max_basilisks`, `quest_min_wyverns`, `quest_max_wyverns`, `quest_min_leviathans`, `quest_max_leviathans`, `quest_min_dragons`, `quest_max_dragons`, `quest_min_land`, `quest_max_land`, `quest_min_farms`, `quest_max_farms`, `quest_min_timber_mills`, `quest_max_timber_mills`, `quest_min_iron_mines`, `quest_max_iron_mines`, `quest_min_gold_mines`, `quest_max_gold_mines`, `quest_min_towers`, `quest_max_towers`, `quest_min_granaries`, `quest_max_granaries`, `quest_min_woodsheds`, `quest_max_woodsheds`, `quest_min_ironpits`, `quest_max_ironpits`, `quest_min_vaults`, `quest_max_vaults`, `quest_chance`, `quest_approved`) VALUES
(1, 'Clean the stables', 'Nobody likes a messy house so your job is to clean out the stables', 'images/quests/clean_stables.png', 1, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10000, 25000, 1000, 2500, 1000, 2500, 1000, 2500, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 1),
(2, 'Feed and water the horses', 'The horses are hungry and can use some water so hurry and get to it', 'images/quests/clean_stables.png', 1, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 20000, 40000, 1000, 2500, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 1),
(3, 'Sharpening Swords', 'We can not conquer kingdoms without owning the sharpest swords in the land', 'images/quests/sword_sharpening.png', 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 0, 0, 30000, 50000, 1000, 2500, 0, 0, 0, 0, 0, 0, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 1),
(4, 'Guard Treasure Room', 'One of the treasure guards needs a break will you fill in for him', 'images/quests/guard_treasure.png', 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 50000, 75000, 1000, 2500, 0, 0, 0, 0, 0, 0, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 1);";

$game_sql[] = "DROP TABLE IF EXISTS `aod_ranks`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_ranks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `player_type` tinyint(4) NOT NULL DEFAULT '0',
  `kingdom_exp` bigint(20) NOT NULL DEFAULT '0',
  `kingdom_wins` bigint(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_reports`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `report` longtext COLLATE utf8_bin NOT NULL,
  `link` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `date` varchar(255) COLLATE utf8_bin NOT NULL,
  `seen` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_units`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_units` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `unit_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `unit_net` int(11) NOT NULL DEFAULT '0',
  `unit_off` int(11) NOT NULL DEFAULT '0',
  `unit_def` int(11) NOT NULL DEFAULT '0',
  `unit_gold` int(11) NOT NULL DEFAULT '0',
  `unit_food` int(11) NOT NULL DEFAULT '0',
  `unit_wood` int(11) NOT NULL DEFAULT '0',
  `unit_iron` int(11) NOT NULL DEFAULT '0',
  `unit_level` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  AUTO_INCREMENT=31;";

$game_sql[] = "
INSERT INTO `aod_units` (`id`, `unit_name`, `unit_net`, `unit_off`, `unit_def`, `unit_gold`, `unit_food`, `unit_wood`, `unit_iron`, `unit_level`) VALUES
(1, 'Villagers', 1, 0, 0, 0, 0, 0, 0, -1),
(2, 'Soldiers', 2, 0, 1, 250, 0, 0, 0, -1),
(3, 'Spies', 3, 0, 0, 250, 100, 0, 0, 1),
(4, 'Macemen', 4, 1, 0, 300, 150, 50, 25, 1),
(5, 'Axemen', 5, 2, 0, 350, 175, 75, 50, 2),
(6, 'Spearmen', 6, 3, 1, 400, 200, 100, 75, 4),
(7, 'Swordsmen', 7, 3, 2, 450, 225, 0, 100, 6),
(8, 'Legionnaires', 8, 3, 3, 500, 250, 0, 125, 8),
(9, 'Knights', 9, 5, 5, 550, 275, 0, 250, 10),
(10, 'Slingers', 10, 0, 6, 600, 300, 0, 25, 12),
(11, 'Bowmen', 11, 4, 8, 650, 325, 125, 100, 14),
(12, 'Long Bowmen', 12, 8, 10, 700, 350, 150, 125, 16),
(13, 'Cross Bowmen', 13, 10, 12, 750, 375, 200, 150, 18),
(14, 'Light Sword Cavalry', 14, 15, 15, 800, 500, 250, 250, 20),
(15, 'Heavy Sword Cavalry', 15, 20, 25, 900, 600, 0, 500, 22),
(16, 'Light Archer Cavalry', 16, 35, 30, 1000, 700, 300, 250, 24),
(17, 'Heavy Archer Cavalry', 17, 50, 50, 1200, 800, 0, 250, 26),
(18, 'Paladin', 18, 75, 50, 1400, 900, 500, 100, 28),
(19, 'Dragon Knights', 19, 125, 125, 1600, 1000, 0, 500, 30),
(20, 'Rams', 20, 150, 0, 1800, 500, 1500, 250, 32),
(21, 'Catapults', 21, 250, 250, 2000, 500, 3000, 500, 34),
(22, 'Heavy Catapults', 22, 500, 500, 2500, 500, 6000, 1000, 36),
(23, 'Ballistas', 23, 750, 500, 5000, 500, 2500, 250, 38),
(24, 'Trebuchets', 24, 1000, 0, 7500, 500, 5000, 500, 40),
(25, 'Chimeras', 25, 1200, 1200, 10000, 2500, 0, 500, 42),
(26, 'Hydras', 26, 1500, 1500, 12500, 5000, 0, 1000, 44),
(27, 'Basilisks', 27, 2000, 2000, 15000, 7500, 0, 1500, 46),
(28, 'Wyverns', 28, 2500, 2500, 17500, 10000, 0, 3000, 48),
(29, 'Leviathans', 29, 3750, 3750, 20000, 15000, 0, 5000, 50),
(30, 'Dragons', 30, 5000, 5000, 35000, 20000, 0, 10000, 75);";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_wins_ranks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL DEFAULT '0',
  `kingdom_name` varchar(255) COLLATE utf8_bin NOT NULL,
  `amount` bigint(20) NOT NULL DEFAULT '0',
  `round` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;";

$game_sql[] = "DROP TABLE IF EXISTS `aod_shop`;";

$game_sql[] = "
CREATE TABLE IF NOT EXISTS `aod_shop` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resource` varchar(255) COLLATE utf8_bin NOT NULL,
  `cost` int(11) NOT NULL DEFAULT '0',
  `kingdom_field` varchar(255) COLLATE utf8_bin NOT NULL,
  `kingdom_max_field` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `amount_offset` int(11) NOT NULL DEFAULT '0',
  `operator` tinyint(4) NOT NULL DEFAULT '0',
  `maxout` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5;";

$game_sql[] = "
INSERT INTO `aod_shop` (`id`, `resource`, `cost`, `kingdom_field`, `kingdom_max_field`, `amount_offset`, `operator`, `maxout`) VALUES
(1, '175,000 units of gold', 5000, 'kingdom_gold', NULL, 175000, 0, 0),
(2, '150,000 units of food', 5000, 'kingdom_food', NULL, 150000, 0, 0),
(3, '125,000 units of wood', 5000, 'kingdom_wood', NULL, 125000, 0, 0),
(4, '100,000 units of iron', 5000, 'kingdom_iron', NULL, 100000, 0, 0);";

$game_sql[] = "DROP TABLE IF EXISTS `aod_fields`;";

$game_sql[] = "
CREATE TABLE `aod_fields` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `field` varchar(255) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;";

$game_sql[] = "
INSERT INTO `aod_fields` (`id`, `field`) VALUES
(NULL, 'kingdom_food'),
(NULL, 'kingdom_wood'),
(NULL, 'kingdom_iron'),
(NULL, 'kingdom_gold'),
(NULL, 'kingdom_land'),
(NULL, 'kingdom_turns'),
(NULL, 'kingdom_turns_max'),
(NULL, 'kingdom_turns_income'),
(NULL, 'kingdom_stamina'),
(NULL, 'kingdom_stamina_max'),
(NULL, 'kingdom_stamina_income'),
(NULL, 'kingdom_villagers'),
(NULL, 'kingdom_villagers_income'),
(NULL, 'kingdom_spies'),
(NULL, 'kingdom_soldiers'),
(NULL, 'kingdom_macemen'),
(NULL, 'kingdom_axemen'),
(NULL, 'kingdom_spearmen'),
(NULL, 'kingdom_swordsmen'),
(NULL, 'kingdom_legionnaires'),
(NULL, 'kingdom_knights'),
(NULL, 'kingdom_slingers'),
(NULL, 'kingdom_bowmen'),
(NULL, 'kingdom_long_bowmen'),
(NULL, 'kingdom_crossbowmen'),
(NULL, 'kingdom_light_sword_cavalry'),
(NULL, 'kingdom_heavy_sword_cavalry'),
(NULL, 'kingdom_light_archer_cavalry'),
(NULL, 'kingdom_heavy_archer_cavalry'),
(NULL, 'kingdom_paladin'),
(NULL, 'kingdom_dragon_knights'),
(NULL, 'kingdom_rams'),
(NULL, 'kingdom_catapults'),
(NULL, 'kingdom_heavy_catapults'),
(NULL, 'kingdom_ballistas'),
(NULL, 'kingdom_trebuchets'),
(NULL, 'kingdom_chimeras'),
(NULL, 'kingdom_hydras'),
(NULL, 'kingdom_basilisks'),
(NULL, 'kingdom_wyverns'),
(NULL, 'kingdom_leviathans'),
(NULL, 'kingdom_dragons'),
(NULL, 'kingdom_farms_lvl'),
(NULL, 'kingdom_farms'),
(NULL, 'kingdom_farms_income'),
(NULL, 'kingdom_timber_mills_lvl'),
(NULL, 'kingdom_timber_mills'),
(NULL, 'kingdom_timber_mills_income'),
(NULL, 'kingdom_iron_mines_lvl'),
(NULL, 'kingdom_iron_mines'),
(NULL, 'kingdom_iron_mines_income'),
(NULL, 'kingdom_gold_mines_lvl'),
(NULL, 'kingdom_gold_mines'),
(NULL, 'kingdom_gold_mines_income'),
(NULL, 'kingdom_towers_lvl'),
(NULL, 'kingdom_towers'),
(NULL, 'kingdom_granaries_lvl'),
(NULL, 'kingdom_granaries'),
(NULL, 'kingdom_granaries_max'),
(NULL, 'kingdom_woodsheds_lvl'),
(NULL, 'kingdom_woodsheds'),
(NULL, 'kingdom_woodsheds_max'),
(NULL, 'kingdom_ironpits_lvl'),
(NULL, 'kingdom_ironpits'),
(NULL, 'kingdom_ironpits_max'),
(NULL, 'kingdom_vaults_lvl'),
(NULL, 'kingdom_vaults'),
(NULL, 'kingdom_vaults_max'),
(NULL, 'kingdom_sponsor'),
(NULL, 'kingdom_coins');";

// This is a list of all the table that the game will install so 
// the system can remove the entire game later on if the admin needs to
$game_tables = "aod_blackmarket|aod_buildings|aod_config|aod_kingdoms|aod_kingdom_news|aod_land_ranks|aod_net_ranks|aod_news|aod_pop_ranks|aod_quests|aod_ranks|aod_reports|aod_units|aod_wins_ranks|aod_shop|aod_fields";

?>